home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / mosmllib / Math.sig < prev    next >
Encoding:
Text File  |  1996-07-03  |  1.7 KB  |  63 lines  |  [TEXT/R*ch]

  1. (* Math -- SML Standard Library *)
  2.  
  3. type real = real
  4.  
  5. exception Sqrt and Trig and Ln
  6.  
  7. val pi : real
  8. val e  : real
  9.  
  10. val sqrt  : real -> real
  11. val sin   : real -> real
  12. val cos   : real -> real
  13. val tan   : real -> real
  14. val atan  : real -> real
  15. val asin  : real -> real
  16. val acos  : real -> real
  17. val atan2 : real * real -> real
  18. val exp   : real -> real
  19. val pow   : real * real -> real
  20. val ln    : real -> real
  21. val log10 : real -> real
  22.  
  23. (*  
  24.    [pi] is the circumference of the circle with diameter 1: 
  25.    3.14159265358979323846.
  26.  
  27.    [e] is the base of the natural logarithm: 2.7182818284590452354.
  28.  
  29.    [sqrt x] is the square root of x.  Raises Sqrt is x < 0.0.
  30.  
  31.    [sin r] is the sine of r, where r is in radians.
  32.  
  33.    [cos r] is the cosine of r, where r is in radians.
  34.  
  35.    [tan r] is the tangent of r, where r is in radians.  Raises Trig if 
  36.    r is a multiple of pi/2.
  37.  
  38.    [atan t] is the arc tangent of t, in the open interval ] ~pi/2, pi/2 [.
  39.  
  40.    [asin t] is the arc sine of t, in the closed interval [ ~pi/2, pi/2 ].  
  41.    Raises Trig if abs x > 1.
  42.  
  43.    [acos t] is the arc cosine of t, in the closed interval [ 0, pi ].
  44.    Raises Trig if abs x > 1.
  45.  
  46.    atan2(y, x) is the arc tangent of y/x, in the interval ] ~pi, pi ],
  47.    except that atan2(y, 0) = sign y * pi/2.  The quadrant of the result
  48.    is the same as the quadrant of the point (x, y).
  49.    Hence sign(cos(atan2(y, x))) = sign x and sign(sin(atan2(y, x))) = sign y. 
  50.  
  51.    [exp x] is e to the x'th power.
  52.  
  53.    [pow (x, y)] is x it the y'th power, defined when 
  54.       y >= 0 and (y integral or x >= 0)
  55.    or y < 0 and ((y integral and x <> 0.0) or x > 0).
  56.  
  57.    We define pow(0, 0) = 1.
  58.  
  59.    [ln x] is the natural logarithm of x (that is, with base e).
  60.  
  61.    [log10 x] is the base-10 logarithm of x.
  62. *)
  63.